package com.kermel.andromeda.engine;

import android.test.AndroidTestCase;

import com.kermel.andromeda.engine.mock.MockCountdownSubscriber;
import com.kermel.common.util.ThreadUtil;

public class CountdownTickerTest extends AndroidTestCase {
    private CountdownTicker countdownTicker;
    private MockCountdownSubscriber countdownSubscriber;
    
    protected void setUp() throws Exception {
        super.setUp();
        
        countdownSubscriber = new MockCountdownSubscriber();
        countdownTicker = new CountdownTicker(countdownSubscriber);
    }

    protected void tearDown() throws Exception {
        countdownTicker = null;
        
        super.tearDown();
    }
    
    public void testCountdownTickerSendsNotification() {
        countdownTicker.start(0, 1);
        ThreadUtil.pauseForSeconds(3);
        assertTrue(countdownSubscriber.isNotificationReceived());
        System.out.println();
    }

}
